package action.vo;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

public class IdNameRowMapper implements RowMapper {

	public IdName mapRow(ResultSet arg0, int arg1) throws SQLException {
		IdName idName = new IdName();
		idName.setId(String.valueOf(arg0.getObject("id")));
		idName.setName(arg0.getString("name"));
		
		if(arg0.getString("code") !=null && !arg0.getString("code").equals("null") && !arg0.getString("code").equals("nothing"))
			idName.setCode(arg0.getString("code"));
		return idName;
	}
}
